<?php

/* 
 把修改后的留言保存数据库里
 */
require'db_con.php';
$id=$_GET['id'];
$username=$_REQUEST['username'];
$sex=$_REQUEST['sex'];
$imgurl=$_REQUEST['imgurl'];
$message=$_REQUEST['message'];
$sql="update t_message set username='$username',message='$message',sex='$sex',imgurl='$imgurl' where id={$id}";
$rs=$db->query($sql);
$db->close();   
if ($rs==true)
    {
        echo "<script type='text/javascript'>";
        echo "window.location.href='index.php' ";
        echo "</script>";
    }
 else 
        
 {
       echo "<script type='text/javascript'>";
       echo "alert('修改留言失败！'); ";
       echo "window.location.href='index.php' ";
       echo"</script>";
 }